import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import '@/utils/imgError'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/permission'
import 'nprogress/nprogress.css'
import 'normalize.css'
import '@/icons'

import SvgIcon from '@/components/SvgComponent' // 计划将svgIcon 注册为全局的组件

import compress from '@/utils/compress' // 注册为全局变量

// import '@/utils/LazyLoad' // 自己封装的图片的懒加载
import VueLazyLoad from 'vue-lazyload'
Vue.component('svg-icon', SvgIcon) // 全局的组件，缺点是用不用都会被打包进去

Vue.prototype.$compress = compress // 插件
Vue.use(VueLazyLoad, {
  error: require('@/assets/images/head.jpg'), // 默认加载的图片
  attempt: 1,
  preLoad: 1.3
})

Vue.use(ElementUI)
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
